<!--Descriptive page name, messages and instructions--><h2><%=h ts("Invite new users") %></h2>
<!--/descriptions-->
<!--subnav-->
<ul class="navigation" role="navigation">
  <li><%= link_to "Manage requests", user_invite_requests_path %></li>
  <li><%= link_to "Manage queue", manage_invite_requests_path %></li>
</ul>
<!--/subnav-->
  
<!--main content-->
<h3>Send an invite code to the following email address</h3>
<%= form_tag :controller => 'admin/admin_invitations', :action => :create do %>
  <p>
    <%= label_tag "invitation[invitee_email]", ts('Email address') %>
    <%= text_field_tag "invitation[invitee_email]", @invitation.try(:invitee_email) || "" %>
  </p>
  <p class="submit"><%= submit_tag ts('Invite user')  %></p>
<% end %>
  
  
 	<h3>Send invite codes to people in our <%= link_to 'invitations queue', invite_requests_path %></h3>
 <p>There are currently <%= InviteRequest.count %> requests in the queue.)</p>
 <%= form_tag url_for(:controller => 'admin/admin_invitations', :action => 'invite_from_queue') do %>
    <p><%= label_tag :invite_from_queue, ts('Number of people to invite') %>: <%= text_field_tag :invite_from_queue  %> </p>
	<p class="submit"><%= submit_tag ts('Invite from queue')  %></p>
  <% end %>



  
	<h3><%=h 'Give invite codes to current users' %></h3>
	 <%= form_tag url_for(:controller => 'admin/admin_invitations', :action => 'grant_invites_to_users') do %>
    <dl>
      <dt><%= label_tag :number_of_invites, ts('Number of invites') %>:</dt>
      <dd><%= text_field_tag :number_of_invites %></dd>

      <dt><%= label_tag :user_group, ts('Users') %>:</dt>
      <dd><%= select_tag :user_group, "<option>All</option><option>With no unused invites</option>".html_safe  %></dd>
    </dl>
    <p class="submit"><%= submit_tag "Generate invites" %></p>
  <% end %>

 
    <h3><%=h 'Track invitations' %></h3>
 <%= form_tag url_for(:controller => 'admin/admin_invitations', :action => 'find'), :method => :get do %>
<dl>
      <dt><%= label_tag :user_name, ts('Enter a user name') %>:</dt>
      <dd><%= text_field_tag :user_name  %></dd>
      <dt><%= label_tag :token, ts('Enter an invite token') %>:</dt>
      <dd><%= text_field_tag :token  %></dd>
      <dt><%= label_tag :invitee_email, ts('Enter all or part of an email address') %>:</dt>
      <dd><%= text_field_tag :invitee_email  %></dd>      
    </dl>
    <p class="submit"><%= submit_tag "Go" %></p>
  <% end %>
<!--/content-->
